package com.fenjiangfan.growth.system.common.exception;

import com.fenjiangfan.growth.system.common.errorcode.BaseErrorcode;
import com.fenjiangfan.growth.system.common.errorcode.IErrorCode;

/**
 * 自定义客户端异常
 */
public class ClientException extends AbsractException {

    public ClientException(IErrorCode errorCode) {
        this(errorCode, null, null);
    }

    public ClientException(String errorMessage) {
        this(BaseErrorcode.CLIENT_ERROR, errorMessage, null);
    }

    public ClientException(IErrorCode errorCode, String errorMessage) {
        this(errorCode, errorMessage, null);
    }

    public ClientException(IErrorCode errorCode, String errorMessage, Throwable throwable) {
        super(errorCode, errorMessage, throwable);
    }

    @Override
    public String toString() {
        return "ClientException{" +
                "code='" + errorCode + "'," +
                "message='" + errorMessage + "'" +
                '}';
    }
}
